Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict access to compilers #139

Closed
wants to merge 1 commit into from

Conversation

monsieuremre
Copy link
Contributor

This can also be implemented as a script pair. lock_compiler and lock_compiler_undo with only root having access to these. Then it might be easier to use compilers without root when needed. But this does not remove functionality anyway. We sould just have to sudo gcc.

@adrelanos
Copy link
Member

About sudo gcc, please see: #132 (comment)

@monsieuremre
Copy link
Contributor Author

I see the point. At this time, we can just disable compilers all together. That is of course a real pain for usability especially for devs. Or this can just be an opt-in feature, using a boot parameter or something else.

@adrelanos
Copy link
Member

design discussion on how to enable/disable this latest draft and discussion here:
#132 (comment)

@adrelanos
Copy link
Member

As said in the other ticket:

So we don't have to parse on/off for each, best to make a syntax similar to systemctl. Here:

  • permission-hardener enable all
  • permission-hardener disable all
  • permission-hardener enable compiler
  • permission-hardener disable compiler
  • permission-hardener enable interpreter
  • permission-hardener disable interpreter

@adrelanos
Copy link
Member

Hmm. To be honest this is no piece of cake to implement.

It's not that difficult.

Currently we got:

  • permission-hardener
  • permission-hardener-undo

Overloading permission-hardener with the config management would be difficult indeed. So first step would be renaming permission-hardener to permission-hardener-enable or so.

Then the logic of config management could be handled by a new, yet to be invented script.

I might get there one day but not a priority right now.

This is actually extremely simple to implement in a full system apparmor policy. Want to run compilers -> gotta use sudo.

As I said before:

Not great. Better to re-enable compiler access than running compilers with root. Because that leads to follow-up issues. Maybe source code refusing to compile or failing to compile (missing environment variables, different PATH, different user, missing configs/files) and confusing resulting file permissions.

@monsieuremre
Copy link
Contributor Author

We might be better off just not touching the compilers and recommending users to uninstall them if they don't do development. This enable-disable solution looks a little too much at the users end. This package would be better if it is just a install and forget kind of thing.

@adrelanos
Copy link
Member

adrelanos commented Nov 7, 2023 via email

@monsieuremre
Copy link
Contributor Author

I don't find this approach to be productive. Hardening as in 'secure by default' should require no further user interaction, let alone forcing them to run commands with options. So for the time being, we can let the compilers be. I'm closing the issue.

@adrelanos
Copy link
Member

Compiler lock still planned. Ticket here:
https://phabricator.whonix.org/T941

But this will take time.

(
Ticket will be migrated to the forums one day.
https://forums.whonix.org/t/abolishing-whonix-phabricator-issue-tracker-moving-issue-tracking-to-forums-migrating-phabricator-whonix-org-to-forums-whonix-org/7112
)

@monsieuremre monsieuremre deleted the patch-2 branch January 17, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants